Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
angular e2e tests - json object forEach method used in data driven tests throw "not a function error"

Have a data.json file and trying to use json data in e2e tests as given in below example. https://www.c-sharpcorner.com/article/data-driven-testing-in-protractor/

The example works fine with github version. Same implementation throw below error with Angular 12 and latest version. It seems the typescript version is unable to recognize the data object as array type. Not sure where to look at. Any help on this is apprecicated.

  • TypeError: calcJson.forEach is not a function

Below is the tsconfig setting:

"compilerOptions": { "baseUrl": "./", "downlevelIteration": true, "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "es2020", "moduleResolution": "node", "experimentalDecorators": true, "importHelpers": true, "target": "es2015", "resolveJsonModule": true, "esModuleInterop": true, "typeRoots": [ "node_modules/@types" ], "lib": [ "es2018", "dom" ],

Package.json file:

"@angular-devkit/build-angular": "~12.2.7", "@angular/cli": "~12.2.7", "@angular/compiler-cli": "~12.2.7", "@angular/language-service": "~12.2.7", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "concat": "^1.0.3", "fs-extra": "^8.1.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "mini-css-extract-plugin": "^2.3.0", "protractor": "~7.0.0", "protractor-beautiful-reporter": "^1.3.6", "ts-node": "~7.0.0", "tslint": "~6.1.0", "typescript": "~4.3.5"

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda